package ch.usi.inf.pf2.alu.nodes;

/**
 * 
 * This node is an identifier node, and implements the function min.
 * 
 * @author Thomas Mantegazzi
 * 
 */

public class MinNode extends IdentifierNode {

	public MinNode(Node[] arguments) {
		super(arguments);
	}

	protected double compute(double[] args) {
		double min = args[0];
		for (double d : args) {
			if (d < min) {
				min = d;
			} else {
			}
		}
		return min;
	}

}
